package com.whiteseason.whitebot.plugin;

import net.lz1998.cq.event.message.CQGroupMessageEvent;
import net.lz1998.cq.event.message.CQPrivateMessageEvent;
import net.lz1998.cq.robot.CQPlugin;
import net.lz1998.cq.robot.CoolQ;
import org.springframework.stereotype.Component;

@Component
public class HelloPlugin extends CQPlugin {
    @Override
    public int onPrivateMessage(CoolQ cq, CQPrivateMessageEvent event) {

        if (event.getMessage().startsWith("[hellowhite]")){
            cq.sendPrivateMsg(event.getUserId(),"响应成功",false);
            return MESSAGE_BLOCK;
        }
        return MESSAGE_IGNORE;
    }

    @Override
    public int onGroupMessage(CoolQ cq, CQGroupMessageEvent event) {
        if (event.getMessage().startsWith("[hellowhite]")){
            cq.sendGroupMsg(event.getGroupId(),"响应成功",false);
            return MESSAGE_BLOCK;
        }
        return MESSAGE_IGNORE;
    }
}
